#include<stdio.h>
#define Max 10
void inplace_swap(int *x,int *y)
	{
	*y = *x^*y;
	*x = *x^*y;
	*y = *x^*y;
}
void reverse_array(int a[],int cnt)
	{
	 int first,last;
	 for(first = 0,last =cnt-1;
	       first<=last;
	       first++,last--)
	inplace_swap(&a[first],&a[last]);
	}
void main()
{
int MAX;
int a[MAX];
int count,i;
printf("please enter the amount of numbers(no more %d):\n",MAX);
scanf("%d",&count);
printf("please enter any numbers as the end\n");
for(i = 1;i<=count;i++)
{
	scanf("%d\n",&a[i-1]);
}
printf("the original array is as follow:\n");
for(i = 1;i<=count;i++)
{
printf("%d ",a[i-1]);
}
reverse_array(a, count);
printf("the new array is as follow:\n");
for(i = 1;i<=count;i++)
{printf("%d ",a[i-1]);
}
}
